<?php

use think\migration\Seeder;

class Auth extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run()
    {
        $data = [
            [
                'uid' => 1,
                'group_id' => 1,
                'create_time' => date('Y-m-d H:i:s'),
                'update_time' => date('Y-m-d H:i:s'),
            ]
        ];
        $auth_group_access = $this->table('auth_group_access');
        $auth_group_access->insert($data)->save();


        //角色
        $auth_group_data = [
            [
                'pid' => 0,
                'name' => '超级管理员',
                'rules'=>'*',
                'create_time' => date('Y-m-d H:i:s'),
                'update_time' => date('Y-m-d H:i:s'),
            ]
        ];
        $auth_group = $this->table('auth_group');
        $auth_group->insert($auth_group_data)->save();
    }
}
